<?php
namespace app\admin\tool;
use app\common\model\Navigation as NavigationModel;



trait Navigation {

    /**
     * 准备后台导航数据
     */
    public function getNavigation(){
        $navigation = NavigationModel::where([])->order('sort desc')->column("*",'id');
        $tree = new Tree($navigation,'id','pid');
        $tree = $tree->getTree();
        return $tree;
    }


}